<template>
  <view class="interview-list">
    <template v-if="list.length">
      <view
        class="interview-list-item"
        v-for="(item, index) in list"
        :key="index"
        @click="handleItem(item, index)"
      >
        <view class="item-top">
          <text class="item-top_left">{{ item.mianshi_time }}</text>
          <text
            :class="['item-top_right', 'status-' + item.interview_status]"
            >{{ item.interview_status_desc }}</text
          >
        </view>
        <view class="item-bottom">
          <view class="item-bottom_left">
            <u-image
              width="140rpx"
              height="140rpx"
              :src="item.logo"
              border-radius="50%"
              class="logo"
            ></u-image>
          </view>
          <view class="item-bottom_right">
            <view class="title">{{ item.title }}</view>
            <view class="cate"><text class="icon icon-company"></text> {{ item.company_name }}</view>
            <view class="detail">
              <text class="icon icon-address"></text>
              {{ item.mianshi_address }}
            </view>
          </view>
        </view>
      </view>
      <u-loadmore
        class="job-more"
        :status="status"
        :load-text="loadText"
      />
    </template>
    <u-empty v-else text="面试通知为空" mode="list"></u-empty>
  </view>
</template>

<script>
export default {
  name: "InterviewNoticeList",
  props: {
    list: {
      type: Array,
      default() {
        return [];
      },
    },
    status: String,
  },
  data() {
    return {
      loadText: {
        loadmore: "加载更多",
        loading: "加载中",
        nomore: "没有更多了",
      },
    };
  },
  methods: {
    handleItem(item, index) {
      this.$emit("item-click", item, index);
    },
  },
};
</script>

<style lang="scss">
$img-base-interview: $img-base + 'interview/';
.interview-list {
  // position: relative;
  padding: 32rpx 32rpx 24rpx;

  &-item {
    background-color: $uni-bg-color;
    border-radius: 20rpx;
    margin-bottom: $uni-spacing-col-lg;
  }

  .item-top {
    display: flex;
    justify-content: space-between;
    padding: 32rpx 0;
    margin: 0 32rpx;
    border-bottom: 2rpx solid $uni-bg-color-border-f1;

    &_left {
      font-size: $uni-font-size-lg;
      font-weight: bold;
    }

    &_right {
      padding: 3rpx 6rpx;
      font-size: 20rpx;
      border: 2rpx solid;
      border-radius: 4rpx;
    }

    .status-40 {
      color: $uni-text-color-888;

    }

    .status-0 {
      color: #0083ff;
    }

    .status-30 {
      color: $uni-text-color-warn;
    }

    .status-100 {
      color: $uni-text-color-success;
    }

    .status-50 {
      color: $uni-text-color-error;
    }
  }

  .item-bottom {
    display: flex;
    padding: 32rpx;

    &_left {
      margin-right: 24rpx;
    }

    &_right {
      .title {
        font-size: $uni-font-size-base;
        font-weight: bold;
        color: #000;
        margin-bottom: $uni-spacing-col-base;
      }

      .cate,
      .detail {
        font-size: $uni-font-size-sm;
        color: $uni-text-color-666;
      }

      .cate {
        margin-bottom: $uni-spacing-col-base;
      }

      .line {
        margin: 0 8rpx;
      }

      .icon {
        margin-right: 10rpx;
      }

      .icon-company {
        width: 32rpx;
        height: 32rpx;
        margin-right: 6rpx;
        background-image: url($img-base-interview + 'enterprise.png');
      }
      .icon-address {
        width: 26rpx;
        height: 26rpx;
        background-image: url($img-base-interview + 'region.png');
      }
    }
  }
}
</style>
